﻿using System;
using UnityEngine;

public class MonoBehaviourCallback : MonoBehaviour
{
    public Action onAwake;
    public Action onEnable;
    public Action onStart;
    public Action onUpdate;
    public Action onLateUpdate;
    public Action onDisable;
    public Action onDestroy;

    public void Awake()
    {
        if(onAwake != null)
        {
            onAwake();
        }
    }

    public void OnEnable()
    {
        if (onEnable != null)
        {
            onEnable();
        }
    }

    public void Start()
    {
        if (onStart != null)
        {
            onStart();
        }
    }

    public void Update()
    {
        if (onUpdate != null)
        {
            onUpdate();
        }
    }

    public void LateUpdate()
    {
        if (onLateUpdate != null)
        {
            onLateUpdate();
        }
    }

    public void OnDisable()
    {
        if (onDisable != null)
        {
            onDisable();
        }
    }

    private void OnDestroy()
    {
        if(onDestroy != null)
        {
            onDestroy();
        }
    }
}
